package cn.hdustea.shopNavigation.ui.presenter

import cn.hdustea.shopNavigation.entity.Life
import cn.hdustea.shopNavigation.ui.contract.LifeContract
import cn.hdustea.shopNavigation.ui.model.LifeModel
import com.hdustea.base.base.BasePresenter

/**
 * <pre>
 *     author : HuQiang
 *     time   : 2020/09/21
 *     desc   :
 *     version: 1.0
 * </pre>
 */
class LifePresenter(mView: LifeContract.View) : BasePresenter<LifeContract.View, LifeContract.Model>(mView), LifeContract.Presenter {

    override fun getModel(): LifeContract.Model = LifeModel()


    override fun getLifeList(page: Int, isRefresh: Boolean) {
        mModel.getLifeList(page, object : PresenterCallback<MutableList<Life>>() {

            override fun callback(data: MutableList<Life>) {
                mView?.dismissLoading()
                mView?.setLifeList(data, isRefresh)
            }

        })
    }


} 